-include ../../Makefile.variable

obj-m := dragonet.o
dragonet-objs := drg_main.o drg_sock.o drg_proc.o drg_stub.o


SVNDEF 	     := -DSVN_REV="\"$(shell svnversion -n .)\""
EXTRA_CFLAGS += -I$(PWD) $(SVNDEF)

INSTDIR := $(DESTDIR)/lib/modules/$(KERNEL_VER)/kernel/net/pf_ring
TARGETDIR := /usr/src/$(KERNEL_VER)/include/linux/

all:
	@if test "$(USER)" = "root"; then \
		echo "********** WARNING WARNING WARNING **********"; \
		echo "*"; \
		echo "* Compiling dragonet as root might lead you to compile errors"; \
		echo "* Please compile dragonet as unpriviliged user"; \
		echo "*"; \
		echo "*********************************************"; \
	fi
	make -C $(APPS_DIR)/kernel/linux-$(KERNEL_VER) SUBDIRS=$(PWD) EXTRA_CFLAGS='$(EXTRA_CFLAGS)' modules

clean:
	make -C $(APPS_DIR)/kernel/linux-$(KERNEL_VER) SUBDIRS=$(PWD) clean

